<template>
	<view class="content">
		<u-button text="用户端" type="primary" @click="to(0)"></u-button>
		<u-gap height="60rpx"></u-gap>
		<u-button text="电工端" type='primary' @click="to(1)"></u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {

		},
		methods: {
			to(t) {
				let tabbar = []
				if (t == 0) {
					tabbar = [{
						text: '首页',
						iconPath: '/static/img/tabbar/home',
						selectedIconPath: '/static/img/tabbar/hometh',
						pagePath: '/pages/tabbar/homey'
					}, {
						text: '服务',
						iconPath: '/static/img/tabbar/fw',
						selectedIconPath: '/static/img/tabbar/fwth',
						pagePath: '/pages/tabbar/service'
					}, {
						text: '订单',
						iconPath: '/static/img/tabbar/order',
						selectedIconPath: '/static/img/tabbar/orderth',
						pagePath: '/pages/tabbar/order'
					}, {
						text: '我的',
						iconPath: '/static/img/tabbar/my',
						selectedIconPath: '/static/img/tabbar/myth',
						pagePath: '/pages/tabbar/myy'
					}, ]
					uni.setStorageSync('dgtabbar', tabbar)
					uni.switchTab({
						url: '/pages/tabbar/homey'
					})
				} else {
					tabbar = [{
						text: '首页',
						iconPath: '/static/img/tabbar/home',
						selectedIconPath: '/static/img/tabbar/hometh',
						pagePath: '/pages/tabbar/homed'
					}, {
						text: '接单大厅',
						iconPath: '/static/img/tabbar/order',
						selectedIconPath: '/static/img/tabbar/orderth',
						pagePath: '/pages/tabbar/receiving'
					},{
						text: '我的',
						iconPath: '/static/img/tabbar/my',
						selectedIconPath: '/static/img/tabbar/myth',
						pagePath: '/pages/tabbar/myd'
					}, ]
					uni.setStorageSync('dgtabbar', tabbar)
					uni.switchTab({
						url: '/pages/tabbar/homed'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.content {
		padding: 150rpx 60rpx 0;
	}
</style>